home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d27 / bebe300.arc / BEBE.DOC next >
Text File  |  1991-05-10  |  46KB  |  1,255 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                              ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  26.                            ╔═══════════════════╗▒▒
  27.                    ▒▒▒▒▒▒▒▒║                   ║▒▒▒▒▒▒▒▒▒▒▒▒
  28.                  ╔═════════╝       BEBE        ╚═════════╗▒▒
  29.                  ║                                       ║▒▒
  30.                  ║     The Batch Enhancer By Elmer       ║▒▒
  31.                  ║             Version 2.00              ║▒▒
  32.                  ║                                       ║▒▒
  33.                  ║  Distributed By and Compliments Of    ║▒▒
  34.                  ║                                       ║▒▒
  35.                  ║          The Winchester BBS           ║▒▒
  36.                  ║            (307) 856-5072             ║▒▒
  37.                  ╚═════════╗                   ╔═════════╝
  38.                            ║    May 1, 1990    ║▒▒
  39.                            ╚═══════════════════╝
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  68.                             Winchester Development
  69.                             C/O The Winchester BBS
  70.                                 (307) 856-5072
  71.           December 9, 1990                                Page # 2
  72.  
  73.           CONTENTS
  74.  
  75.               1. LICENSE.................................. 3
  76.  
  77.               2. THEORY................................... 4
  78.  
  79.               3. OVERVIEW................................. 5
  80.  
  81.               4. NOTICE................................... 8
  82.  
  83.               5. COMMANDS................................. 9
  84.                 A. BOX.................................... 9
  85.                 B. CALC................................... 8
  86.                 C. COLOR.................................. 10
  87.                 D. GETKEY................................. 11
  88.                 E. GETSTRNG............................... 11
  89.                 F. HOLD................................... 12
  90.                 G. LOCATE................................. 12
  91.                 H. LOWER.................................. 12
  92.                 I. PARSE.................................. 13
  93.                 J. SAY.................................... 14
  94.                 K. SENDKEY................................ 14
  95.                 L. STATUS................................. 15
  96.                 M. STRINGSZ............................... 18
  97.                 N. SUBSTRNG............................... 18
  98.                 O. UPPER.................................. 19
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  134.                             Winchester Development
  135.                             C/O The Winchester BBS
  136.                                 (307) 856-5072
  137.           December 9, 1990                                Page # 3
  138.  
  139.               1. LICENSE
  140.  
  141.           Copyright 1989,1990 Winchester Development, All Rights
  142.           Reserved.
  143.  
  144.               You may use BEBE on your system to test it's
  145.           suitability for your application. After determination of
  146.           suitability you must register your copy. You are free to
  147.           copy and distribute THE TRIAL VERSION of BEBE for
  148.           noncommercial use IF:
  149.  
  150.           NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.
  151.           IT IS NOT MODIFIED IN ANY WAY.
  152.  
  153.           Winchester Development hereby disclaims all warranties
  154.           relating to this software, whether express or implied,
  155.           including without limitation any implied warranties of
  156.           merchantability or fitness for a particular purpose.
  157.           Winchester Development will not be liable for any special,
  158.           incidental, consequential, indirect or similar damages due
  159.           to loss of data or any other reason, even if Winchester
  160.           Development or an agent of Winchester Development has been
  161.           advised of the possibility of such damages. In no event
  162.           shall Winchester Development's liability for any damages
  163.           ever exceed the price paid for the license to use
  164.           software, regardless of the form of the claim. The person
  165.           using the software bears all risk as to the quality and
  166.           performance of the software.
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  200.                             Winchester Development
  201.                             C/O The Winchester BBS
  202.                                 (307) 856-5072
  203.           December 9, 1990                                Page # 4
  204.  
  205.           2. THEORY
  206.  
  207.               Thank you for trying BEBE. The main purpose for BEBE
  208.           is to give your batch files power and flexibility. BEBE is
  209.           loosely patterned after BE, the Batch Enhancer that is
  210.           included with the Norton Utilities. The Norton version
  211.           will perform some functions that BEBE will not, (like
  212.           produce different tones and durations of beeps that you
  213.           can use to play music), and BEBE will perform some
  214.           functions that the Norton version will not, (batch file
  215.           calculator and status reports for instance). There are
  216.           many batch file enhancers on the market and in the public
  217.           domain. The most powerful of these are complete extended
  218.           languages. These extended batch file languages have two
  219.           basic drawbacks:
  220.  
  221.           One - They are generally memory resident. Now two years
  222.                 ago I wouldn't have thought much about this, but
  223.                 today I have a 20 Mhz machine with 2 Mb RAM and by
  224.                 the time I get the necessary drivers and network
  225.                 loaded, I can barely get by with my application
  226.                 software. The term memory-resident has become a four
  227.                 letter word.
  228.  
  229.           Two - The extended languages that I have tried have given
  230.                 me various compatibility problems. Some would not
  231.                 run at all on a Turbo XT with DOS 3.30.
  232.  
  233.           In addition to the languages mentioned above there is a
  234.           veritable plethora of stand alone utilities that will
  235.           give most if not all of the features in BEBE. The biggest
  236.           advantage that BEBE offers is the all-in-one concept. A
  237.           bunch of little COM files can eat disk space in a hurry,
  238.           and if you distribute your batch files it can be a real
  239.           nightmare trying to make sure that you have furnished all
  240.           the supporting files the batch programs call. BEBE does it
  241.           all in a single COM file.
  242.  
  243.           **********************************************************
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  266.                             Winchester Development
  267.                             C/O The Winchester BBS
  268.                                 (307) 856-5072
  269.           December 9, 1990                                Page # 5
  270.  
  271.           3. OVERVIEW
  272.  
  273.           The BEBE sub-commands are listed below with a brief
  274.           discussion of each commands purpose in life.
  275.  
  276.               BOX -        The box command allows you to draw a box
  277.                            on the screen wherever you would like,
  278.                            using one of four different types of
  279.                            boxes.
  280.  
  281.               CALC -       The calc command is a command line
  282.                            calculator. This allows you to do some
  283.                            basic arithmetic in your batch files.
  284.                            Allowing you to perform all kinds of
  285.                            sophisticated looping and branching, as
  286.                            well as the obvious math functions.
  287.                            Examples of this technique are shown
  288.                            below. Results are stored in an
  289.                            environment variable.
  290.  
  291.               COLOR -      This command allows you to set your
  292.                            screen attributes and colors. You can
  293.                            clear the screen to a specified color, or
  294.                            simply set a color to be use by a
  295.                            following echo or BEBE BOX command.
  296.  
  297.               GETKEY -     This command will accept a single
  298.                            keypress from the user. The key that is
  299.                            typed is stored in an environment
  300.                            variable. A prompt can also be displayed.
  301.  
  302.               GETSTRING -  This command allows you to prompt for
  303.                            user string input and stores the typed
  304.                            response in an environment variable.
  305.  
  306.               HOLD -       Hold will pause for a specified amount of
  307.                            time and display a specified message.
  308.  
  309.               LOCATE -     Locate will position the cursor anywhere
  310.                            on the screen.
  311.  
  312.           *   LOWER -      The lower command, (and it's sibling the
  313.                            upper command) convert a text string to
  314.                            all one case.
  315.  
  316.           *   PARSE -      Parse allows you to break a sentence into
  317.                            pieces. It also will break a text string
  318.                            at a given punctuation. If, for instance
  319.                            you need to separate the fields of a
  320.                            comma delimited ASCII export from a
  321.                            database you can do so with the PARSE
  322.                            command.
  323.  
  324.               SAY -        The say command will display the
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  332.                             Winchester Development
  333.                             C/O The Winchester BBS
  334.                                 (307) 856-5072
  335.           December 9, 1990                                Page # 6
  336.  
  337.                            specified text on the screen. The
  338.                            difference between SAY and ECHO is that
  339.                            the SAY command does not add a carriage
  340.                            return - line feed at the end of the
  341.                            command. This is useful for displaying
  342.                            two or more variables on one line.
  343.  
  344.               SENDKEY -    Sendkey will pass the specified
  345.                            keystrokes to the specified application.
  346.                            Examples are given below.
  347.  
  348.               STATUS -     An extremely useful command, status will
  349.                            report the current directory, current
  350.                            disk drive, free disk space, day of the
  351.                            month, day of the week, whether or not
  352.                            any expanded memory is installed, and if
  353.                            so how much is available, the size of a
  354.                            file or group of files, current hour,
  355.                            minute, second, month and year. You can
  356.                            get the status of one of these or all of
  357.                            them at once. All results are stored in
  358.                            environment variables. In addition, you
  359.                            can clear all the environment variables
  360.                            that BEBE creates.
  361.  
  362.            *  STRINGSIZE - This command is a part of a trio of
  363.                            extremely powerful string handling
  364.                            commands which include the PARSE,
  365.                            STRINGSIZE, and SUBSTRING commands. This
  366.                            command allows you to determine the
  367.                            length of a string.
  368.  
  369.            *  SUBSTRING -  The SUBSTRING command will extract a
  370.                            section of text from within a text
  371.                            string.
  372.  
  373.           *   UPPER -      Converts a text string to upper case.
  374.                            (See also LOWER).
  375.  
  376.  
  377.            All of the commands that set environment variables give
  378.           you the option of sending the value out to a text file, or
  379.           creating a batch file that will set the environment
  380.           variable just as BEBE would. This may seem a bit
  381.           redundant, but those of you using Windows, Desqview or
  382.           running BEBE by shelling out of an application program can
  383.           finally use the environment commands. Previously, BEBE
  384.           would not set an environment in the secondary copy of
  385.           command.com these programs evoke. The first copy of the
  386.           environment would be updated but not the second copy. Now
  387.           by using the batch file feature of BEBE, you can update
  388.           the secondary copy of the environment variable. For
  389.           instance:
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  398.                             Winchester Development
  399.                             C/O The Winchester BBS
  400.                                 (307) 856-5072
  401.           December 9, 1990                                Page # 7
  402.  
  403.           BEBE STATUS BAT ALL
  404.           FOR %%F IN (BEBEVER DIRE DISK DISKSPAC DOM DOW EMMFREE
  405.           EMMSTAT FILESIZE HOUR MEMFREE MINUTE MONTH SECOND YEAR) DO
  406.           %%F
  407.  
  408.           (the last 3 lines should all be on one line in your batch
  409.           file)
  410.  
  411.           These two lines in a batch file running in a secondary
  412.           command processor will accomplish the same thing the BEBE
  413.           STATUS ALL command would accomplish in the primary
  414.           environment. All batch files and text files created with
  415.           these features will have the same name as the command. For
  416.           example BEBE CALC FILE 1 + 3 will create a text file with
  417.           the name of CALC.TXT that contains the value 4. The
  418.           command BEBE CALC BAT 1 + 3 will create a file called
  419.           CALC.BAT the contains the line SET CALC=4.
  420.  
  421.           *  Commands that have an asterisk next to them are only
  422.           available in the registered versions of BEBE. In addition,
  423.           the ability to send values to a text file are only
  424.           available in the registered version. The trial version
  425.           does however provide the batch file feature for
  426.           environment commands. In all probability major
  427.           enhancements and features will only be added to the
  428.           registered version. See the README.BB file that
  429.           accompanies this program for registration info.
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  464.                             Winchester Development
  465.                             C/O The Winchester BBS
  466.                                 (307) 856-5072
  467.           December 9, 1990                                Page # 8
  468.  
  469.           4. NOTICE
  470.  
  471.           ***********************  NOTICE !  ***********************
  472.  
  473.           Because of the extensive use of environment variables it
  474.           is suggested that the following line be added to your
  475.           CONFIG.SYS file.
  476.  
  477.           shell = c:\command.com /e:500/a/p
  478.  
  479.           This line sets an environment space big enough for 500
  480.           characters, which should accommodate almost any system.
  481.           Without this line it is doubtful that the BEBE STATUS ALL
  482.           command will function properly.
  483.  
  484.           **********************************************************
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  530.                             Winchester Development
  531.                             C/O The Winchester BBS
  532.                                 (307) 856-5072
  533.           December 9, 1990                                Page # 9
  534.  
  535.           5. COMMANDS
  536.  
  537.               BOX {top} {left} {bottom} {right} {boxtype}
  538.  
  539.                    {top}     is the number of the topmost row to
  540.                              start drawing the box on.
  541.  
  542.                    {left}    is the number of the leftmost column to
  543.                              start drawing the box on.
  544.  
  545.                    {bottom}  is the bottom row of the box.
  546.  
  547.                    {right}   is the rightmost column of the box.
  548.  
  549.                    {boxtype} is a number representing one of the
  550.                              four available box types. The four box
  551.                              types are as follows:
  552.                                  ┌─────┐ ╔═════╗  ╒═════╕ ╓─────╖
  553.                                  │  1  │ ║  2  ║  │  3  │ ║  4  ║
  554.                                  └─────┘ ╚═════╝  ╘═════╛ ╙─────╜
  555.  
  556.                    EXAMPLE:  BEBE BOX 4 10 14 30 2
  557.  
  558.                    This example will draw a double line box that is
  559.                    ten rows long by twenty columns wide starting at
  560.                    row four column ten. Note that BEBE starts
  561.                    counting at one not zero, so the home position
  562.                    would be row 1 column 1.
  563.  
  564.               CALC {bat} {file} {value} {operator} {value}
  565.  
  566.                    {bat}     is the flag that tells BEBE to create a
  567.                              batch file with the line SET
  568.                              CALC={result}. When executed this batch
  569.                              file will set an environment variable
  570.                              in a secondary command processor as
  571.                              described in the OVERVIEW section of
  572.                              this document.
  573.  
  574.                    {file}    is the flag that tells BEBE to send the
  575.                              result of the calculation to a text
  576.                              file.
  577.  
  578.                    {value}   is the first value to operate on.
  579.  
  580.                    {operator} This is the operator that determines
  581.                              the type of calculation to be
  582.                              performed. The valid operators and
  583.                              their associated functions are as
  584.                              follows:
  585.  
  586.                              +  Addition
  587.                              -  Subtraction
  588.                              *  Multiplication
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  596.                             Winchester Development
  597.                             C/O The Winchester BBS
  598.                                 (307) 856-5072
  599.           December 9, 1990                                Page # 10
  600.  
  601.                              /  Division
  602.                              m  Modulus
  603.                              a  Returns Absolute Value Of First
  604.                              {value}
  605.  
  606.                    The result of the calculation is stored in a DOS
  607.                    environment variable called %CALC%
  608.  
  609.                    EXAMPLE:  BEBE CALC 30 / 10
  610.  
  611.                    This example would store the value 3 in the
  612.                    %CALC% environment variable.
  613.                    You can use CALC to perform incrementing in your
  614.                    batch files. Consider the following example...
  615.  
  616.                    echo off
  617.                    cls
  618.                    set calc=1
  619.                    :checkit
  620.                    if not %calc% == 11 goto loop
  621.                    goto end
  622.                    :loop
  623.                    echo %calc%
  624.                    calc %calc% + 1
  625.                    goto checkit
  626.                    :end
  627.                    echo DONE!
  628.  
  629.                    This example will display the numbers 1 - 10 and
  630.                    then exit with the message DONE!. A simplified
  631.                    example, but it helps to illustrate the powerful
  632.                    kind of looping that can be performed with CALC.
  633.  
  634.               COLOR {attribute} {foreground} on {background}
  635.                     {normal} {clear}
  636.  
  637.                    {attribute} The attribute is one of four
  638.                              foreground attributes. The following
  639.                              attributes are valid:
  640.  
  641.                              BRIGHT
  642.                              BLINKING
  643.                              UNDERLINE (mono monitors only)
  644.                              REVERSE
  645.  
  646.                    {foreground} The following foreground colors are
  647.                              valid:
  648.  
  649.                              BLACK
  650.                              BLUE
  651.                              CYAN
  652.                              GREEN
  653.                              MAGENTA
  654.                              RED
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  662.                             Winchester Development
  663.                             C/O The Winchester BBS
  664.                                 (307) 856-5072
  665.           December 9, 1990                                Page # 11
  666.  
  667.                              YELLOW
  668.                              WHITE
  669.                              ON  This is an optional word
  670.                              supported only to make the command more
  671.                              like English.
  672.  
  673.                    {background} The same colors that are used in the
  674.                              foreground variable are valid in the
  675.                              background variable.
  676.  
  677.                    {normal}  If you get some very ugly color
  678.                              combination on the screen and want to
  679.                              get it off as quickly as possible, this
  680.                              option will return the current colors
  681.                              to white on black.
  682.  
  683.                    {clear}   The clear option will clear the screen
  684.                              to whatever the selected color
  685.                              combination is. The default is to not
  686.                              clear the screen.
  687.  
  688.                    EXAMPLE:  BEBE COLOR BRIGHT WHITE ON BLUE
  689.  
  690.                    This example set a bold white foreground with a
  691.                    blue background.
  692.  
  693.                    BEBE COLOR NORMAL CLEAR
  694.  
  695.                    This example clears the screen to white on black.
  696.  
  697.               GETKEY {bat} {file} {message}
  698.  
  699.                    {bat}     See the OVERVIEW section.
  700.  
  701.                    {file}    See the OVERVIEW section.
  702.  
  703.                    {message} Here you can supply a prompt to be
  704.                              displayed to the user at input time.
  705.  
  706.                    EXAMPLE:  BEBE GETKEY Do you choose number 1 or 2
  707.  
  708.                    This example will display the prompt Do you
  709.                    choose number 1 or 2 to the user and store the
  710.                    answer in an environment variable called
  711.                    %GETKEY%.
  712.  
  713.                GETSTRNG  {bat} {file} {message}
  714.  
  715.                    {bat}     See the OVERVIEW section.
  716.  
  717.                    {file}    See the OVERVIEW section.
  718.  
  719.                    {message} Here you can supply a prompt to be
  720.                              displayed to the user at input time.
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  728.                             Winchester Development
  729.                             C/O The Winchester BBS
  730.                                 (307) 856-5072
  731.           December 9, 1990                                Page # 12
  732.  
  733.  
  734.                    EXAMPLE:  BEBE GETSTRNG What Is Your First Name?
  735.  
  736.                    This example will display the prompt What Is Your
  737.                    First Name? to the user and store the answer in
  738.                    an environment variable called %GETSTRNG%.
  739.  
  740.  
  741.               HOLD {duration} {message}
  742.  
  743.                    {duration} This is the amount of time in seconds
  744.                              that you would like to suspend the
  745.                              execution of your batch file.
  746.  
  747.                    {message} This is an optional message that will
  748.                              be displayed during the pause.
  749.  
  750.                    EXAMPLE:  BEBE HOLD 5 I am holding for 5
  751.                    seconds...
  752.  
  753.                    This example is pretty self explanatory. Also,
  754.                    the pause can be interrupted by pressing a key.
  755.  
  756.               LOCATE {row} {column}
  757.  
  758.                    {row}     This is the number for the row where
  759.                              you would like the cursor placed.
  760.  
  761.                    {column}  This is the number for the column
  762.                              where you would like the cursor placed.
  763.  
  764.                    EXAMPLE:  BEBE LOCATE 5 25
  765.  
  766.                    This example would obviously place the cursor at
  767.                    row 5 column 25. Note that BEBE starts counting
  768.                    at one not zero, so the home position would be
  769.                    row 1 column 1.
  770.  
  771.               LOWER {bat} {file} {variable}
  772.  
  773.                    {bat}     See the OVERVIEW section.
  774.  
  775.                    {file}    See the OVERVIEW section.
  776.  
  777.                    {variable} This is an environment variable that
  778.                              contains the string that you want to
  779.                              convert to lower case text. As with all
  780.                              the BEBE string handling commands, you
  781.                              can substitute a string enclosed in
  782.                              quotes for an environment variable. The
  783.                              converted text is stored in a variable
  784.                              called %LOWER%.
  785.  
  786.                    EXAMPLE:  BEBE LOWER %GETSTRNG%
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  794.                             Winchester Development
  795.                             C/O The Winchester BBS
  796.                                 (307) 856-5072
  797.           December 9, 1990                                Page # 13
  798.  
  799.                    or
  800.                              BEBE LOWER "This Should Be Lower Text"
  801.  
  802.                    This would create the environment variable
  803.                    %LOWER% that contains the following string:
  804.  
  805.                              this should be lower text
  806.  
  807.               PARSE {bat} {file} {variable}
  808.  
  809.                    {bat}     See the OVERVIEW section.
  810.  
  811.                    {file}    See the OVERVIEW section.
  812.  
  813.                    {variable} This is an environment variable that
  814.                              contains the string you want to parse.
  815.                              This could also be a string from the
  816.                              DOS command line if you surround the
  817.                              string with quotes. The parse command
  818.                              creates two environment variables. The
  819.                              first variable, PARSEA, contains the
  820.                              value that was extracted from the
  821.                              string, and the second one, PARSEB,
  822.                              contains the remainder of the string.
  823.                              The parse command automatically breaks
  824.                              on commas, quotation marks, periods,
  825.                              exclamation points, colons, backslashes
  826.                              and frontslashes. This makes it
  827.                              especially easy to parse a pathname.
  828.  
  829.                    EXAMPLE:  ECHO OFF
  830.                              SET RECORD=Elmer,Robinson,Riverton,Wy
  831.                              :REPEAT
  832.                              BEBE PARSE %RECORD%
  833.                              IF %PARSEA%A==A GOTO LISTEND
  834.                              ECHO %PARSEA%
  835.                              SET RECORD=%PARSEB%
  836.                              GOTO REPEAT
  837.                              :LISTEND
  838.  
  839.                    This would produce the following output:
  840.  
  841.                    Elmer
  842.                    Robinson
  843.                    Riverton
  844.                    Wy
  845.  
  846.                    You could also write this batch file the
  847.                    following way:
  848.  
  849.                              ECHO OFF
  850.                              BEBE PARSE "Elmer,Robinson,Riverton,Wy"
  851.                              :REPEAT
  852.                              BEBE PARSE %RECORD%
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  860.                             Winchester Development
  861.                             C/O The Winchester BBS
  862.                                 (307) 856-5072
  863.           December 9, 1990                                Page # 14
  864.  
  865.                              IF %PARSEA%A==A GOTO LISTEND
  866.                              ECHO %PARSEA%
  867.                              SET RECORD=%PARSEB%
  868.                              GOTO REPEAT
  869.                              :LISTEND
  870.  
  871.               SAY {message}
  872.  
  873.                    {message} This is the string you would like
  874.                              displayed. Look at the following  batch
  875.                              file example to get an idea  of the
  876.                              usefulness of this command. Again, it
  877.                              is a simplified example but it gets the
  878.                              idea across.
  879.  
  880.                    EXAMPLE:  ECHO OFF
  881.                              CLS
  882.                              BEBE GETSTRING AGE How Old Are You?
  883.                              BEBE CALC %AGE% + 1
  884.                              SET STOPPER=%RESULT%
  885.                              SET COUNTER=1
  886.                              :LOOP
  887.                              BEBE SAY %AGE%
  888.                              BEBE CALC %COUNTER% + 1
  889.                              SET COUNTER=%RESULT%
  890.                              IF %COUNTER%==%STOPPER% GOTO END
  891.                              GOTO LOOP
  892.                              :END
  893.                              ECHO ^@
  894.  
  895.                    Note that the symbol after the echo on the last
  896.                    line is the DOS null symbol that the F7 function
  897.                    key contains. This example will ask for the users
  898.                    age, and then display the answer in a line for as
  899.                    many times as the user is old. Say for instance
  900.                    the user is 21 years old, the screen would look
  901.                    something like this...
  902.  
  903.                    How Old Are You? 21
  904.                    212121212121212121212121212121212121212121
  905.  
  906.               SENDKEY {keys} {program}
  907.  
  908.                    {keys}    These are the keystrokes that you would
  909.                              like fed into the keyboard buffer. Type
  910.                              the characters just as you would
  911.                              normally. If you want to send
  912.                              non-typeable keys, (enter for example),
  913.                              simply designate that key by a
  914.                              backslash followed by the decimal value
  915.                              for that key. The enter key for
  916.                              instance would be shown as a \13 since
  917.                              13 is the value for that key.
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  926.                             Winchester Development
  927.                             C/O The Winchester BBS
  928.                                 (307) 856-5072
  929.           December 9, 1990                                Page # 15
  930.  
  931.                    {program} This is the command you would type to
  932.                              load the program you want to feed
  933.                              keystrokes to.
  934.  
  935.                    EXAMPLE:  BEBE SENDKEY \13N\13 FORMAT A: /S
  936.  
  937.                    This example will load the format command to
  938.                    format a new floppy disk in drive A:, and place a
  939.                    system on that disk. It will then feed an Enter
  940.                    to the format command in response to the Strike
  941.                    any key prompt to immediately begin formatting.
  942.                    When the format command is finished it will
  943.                    receive an N Enter in response to the format
  944.                    another? prompt and immediately stop.
  945.  
  946.               STATUS {bat} {file} {all} {bebever} {clear} {all}
  947.                      {files} {dire} {disk} {diskspac} {dom} {dow}
  948.                      {emmfree} {emmstat} {filesize} {hour} {memfree}
  949.                      {minute} {month} {second} {year}
  950.  
  951.                    {bat}     See the OVERVIEW section.
  952.  
  953.                    {file}    See the OVERVIEW section.
  954.  
  955.                    {all}     This command will report all of the
  956.                              information that the status command is
  957.                              capable of. This command will not
  958.                              accept any parameters, so each command
  959.                              will use its built in defaults. Please
  960.                              note that you will not be able to use
  961.                              this command unless the line mentioned
  962.                              in the OVERVIEW section of this
  963.                              document has been added to your
  964.                              config.sys file.
  965.  
  966.                    {bebever} This will report the version of BEBE
  967.                              you are using in the environment
  968.                              variable %BEBEVER%.
  969.  
  970.                    {clear}   As you may have noticed, BEBE makes
  971.                              extensive use of DOS environment
  972.                              variables. Because DOS allocates a
  973.                              relatively small amount of space for
  974.                              the environment by default, you should
  975.                              exercise some good housekeeping
  976.                              practices in your batch files. As a
  977.                              rule of thumb, the last thing your
  978.                              batch files should do before exiting is
  979.                              clean out the environment variables
  980.                              that have been set and are no longer
  981.                              needed. This command provides you with
  982.                              an easy way to do this. Issuing the
  983.                              command BEBE STATUS CLEAR will erase
  984.                              all of the environment variables that
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  992.                             Winchester Development
  993.                             C/O The Winchester BBS
  994.                                 (307) 856-5072
  995.           December 9, 1990                                Page # 16
  996.  
  997.                              BEBE sets. This includes all variables
  998.                              set by the status report, the CALC,
  999.                              GETKEY, GETSTRNG, LOWER, PARSEA, PARSEB
  1000.                              STRINGSZ, SUBSTRNG and UPPER variables
  1001.                              set by their respective commands.
  1002.  
  1003.                    {all}     This command accompanies the clear
  1004.                              command. It tells BEBE to clear the
  1005.                              environment variables, and to erase all
  1006.                              of the files that it has created. The
  1007.                              syntax is BEBE STATUS CLEAR ALL.
  1008.  
  1009.                    {files}   This also accompanies the clear
  1010.                              command. The command BEBE STATUS CLEAR
  1011.                              FILES will erase all of the files BEBE
  1012.                              has created but leave the environment
  1013.                              variables in place.
  1014.  
  1015.                    {dire}    This asks the status command to report
  1016.                              the current directory. The result is
  1017.                              stored in the environment variable
  1018.                              %DIRE%.
  1019.  
  1020.                    {disk}    This reports the currently logged disk
  1021.                              drive. The disk is reported as both the
  1022.                              drive letter and the colon ":". So if
  1023.                              you are currently on drive C: this
  1024.                              command would set the environment
  1025.                              variable %DISK% to the value C:.
  1026.  
  1027.                    {diskspac} This stores the amount of free disk
  1028.                              space in kilobytes in the environment
  1029.                              variable %DISKSPAC%. You can optionally
  1030.                              supply a drive letter to check for free
  1031.                              disk space. For instance the command:
  1032.  
  1033.                              BEBE STATUS DISKSPAC A:
  1034.  
  1035.                              would report the amount of free disk
  1036.                              space that is available on drive A:
  1037.                              regardless of your current location.
  1038.  
  1039.                    {dom}     This stores the day of the month in the
  1040.                              environment variable %DOM%.
  1041.  
  1042.                    {dow}     This stores the day of the week in the
  1043.                              environment variable %DOW%. This is not
  1044.                              a numeric representation of the day of
  1045.                              the week, but the actual day. So if
  1046.                              today is Tuesday this command will set
  1047.                              %DOW% = TUESDAY.
  1048.  
  1049.                    {emmfree} This command will report the amount of
  1050.                              available Expanded memory. This memory
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  1058.                             Winchester Development
  1059.                             C/O The Winchester BBS
  1060.                                 (307) 856-5072
  1061.           December 9, 1990                                Page # 17
  1062.  
  1063.                              must meet the LIM 4.0 specification.
  1064.                              Note that this is not the amount of
  1065.                              Expanded memory that is installed, but
  1066.                              rather the amount that is free. The
  1067.                              result is reported in kilobytes and
  1068.                              stored in the environment variable
  1069.                              %EMMFREE%.
  1070.  
  1071.                    {emmstat} This checks to see if there is any
  1072.                              Expanded memory installed and sets the
  1073.                              variable %EMMSTAT% equal to T if
  1074.                              Expanded memory is installed and F if
  1075.                              no expanded memory exists. Again, the
  1076.                              memory must meet the LIM 4.0
  1077.                              specifications.
  1078.  
  1079.                    {filesize} This command will report the size of a
  1080.                              single file or a group of files. If no
  1081.                              filespec is given the default is to
  1082.                              report the size of all files in the
  1083.                              current directory. The value is stored
  1084.                              in the variable %FILESIZE%. For
  1085.                              example:
  1086.  
  1087.                              BEBE STATUS FILESIZE C:\DOS\*.*
  1088.  
  1089.                              will report the total size of your DOS
  1090.                              subdirectory in kilobytes. Try these
  1091.                              batch files....
  1092.  
  1093.                              ECHO OFF
  1094.                              CLS
  1095.                              SET CALC=0
  1096.                              FOR %%F IN (*.*) DO CALL SIZE.BAT %%F
  1097.                              ECHO THE TOTAL IS %CALC%
  1098.  
  1099.                              (this batch file should be named
  1100.                              SIZE.BAT)
  1101.  
  1102.                              ECHO OFF
  1103.                              ECHO %1
  1104.                              BEBE STATUS FILESIZE %1
  1105.                              BEBE CALC %FILESIZE% + %CALC%
  1106.  
  1107.                              This example will display the name of
  1108.                              every file in the current subdirectory
  1109.                              and display the total size of the files
  1110.                              at the end of the list. Note that the
  1111.                              call command in the first batch file
  1112.                              means that this will only work with DOS
  1113.                              version 3.30 or greater.
  1114.  
  1115.                    {hour}    This stores the current hour in the
  1116.                              variable %HOUR%. This command uses a 24
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  1124.                             Winchester Development
  1125.                             C/O The Winchester BBS
  1126.                                 (307) 856-5072
  1127.           December 9, 1990                                Page # 18
  1128.  
  1129.                              hour clock so 1PM is stored as the
  1130.                              value 13.
  1131.  
  1132.                    {memfree} This command will report the amount of
  1133.                              available Conventional memory. Note
  1134.                              that this is not the amount of
  1135.                              Conventional memory that is installed,
  1136.                              but rather the amount that is free. The
  1137.                              result is reported in kilobytes and
  1138.                              stored in the environment variable
  1139.                              %MEMFREE%.
  1140.  
  1141.                    {minute}  This stores the current minute in the
  1142.                              variable %MINUTE%.
  1143.  
  1144.                    {month}   This stores the number of the month in
  1145.                              the variable %MONTH%.
  1146.  
  1147.                    {second}  This stores the current second in the
  1148.                              variable %SECOND%.
  1149.  
  1150.                    {year}    This stores the current year in the
  1151.                              variable %YEAR%. The value is stored in
  1152.                              its entirety, so 1989 is stored as 1989
  1153.                              not simply 89.
  1154.  
  1155.               STRINGSZ   {bat} {file} {variable}
  1156.           
  1157.                    {bat}     See the OVERVIEW section.
  1158.  
  1159.                    {file}    See the OVERVIEW section.
  1160.  
  1161.                    {variable} This is an environment variable that
  1162.                              contains the string you want to
  1163.                              measure. In place of an environment
  1164.                              variable you can also enclose the
  1165.                              actual string in quotes. The length of
  1166.                              the string is reported in the
  1167.                              environment variable %STRINGSZ%.
  1168.  
  1169.                    EXAMPLE:  ECHO OFF
  1170.                              SET TEMP1=TESTING
  1171.                              BEBE STRINGSZ %TEMP1%
  1172.                              ECHO %TEMP1% is %STRINGSZ% characters
  1173.  
  1174.                    This would produce the following display:
  1175.  
  1176.                    TESTING is 7 characters
  1177.  
  1178.               SUBSTRNG  {bat} {file} {variable1} {variable2}
  1179.                         {variable3}
  1180.           
  1181.                    {bat}     See the OVERVIEW section.
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.                 BEBE - The Batch Enhancer By Elmer Version 3.00
  1190.                             Winchester Development
  1191.                             C/O The Winchester BBS
  1192.                                 (307) 856-5072
  1193.           December 9, 1990                                Page # 19
  1194.  
  1195.                    {file}    See the OVERVIEW section.
  1196.  
  1197.                    {variable1} This is an environment variable that
  1198.                              contains the string you want to work
  1199.                              on. In place of an environment variable
  1200.                              you can also enclose the actual string
  1201.                              in quotes.
  1202.  
  1203.                    {variable2} This is a number that represents the
  1204.                              position at which you want to start
  1205.                              extracting text, counting from the
  1206.                              left.
  1207.  
  1208.                    {variable3} This is a number that represents the
  1209.                              number of characters to extract. The
  1210.                              result is stored in the environment
  1211.                              variable %SUBSTRNG%.
  1212.  
  1213.                    EXAMPLE:  ECHO OFF
  1214.                              SET TEMP1=ABCDEFG
  1215.                              BEBE STRINGSZ %TEMP1%
  1216.                              BEBE CALC %STRINGSZ% - 2
  1217.                              BEBE SUBSTRNG %TEMP1% 1 %CALC%
  1218.                              ECHO %SUBSTRNG%
  1219.  
  1220.                    This would produce the following display:
  1221.  
  1222.                    ABCDE
  1223.  
  1224.               UPPER {bat} {file} {variable}
  1225.  
  1226.                    {bat}     See the OVERVIEW section.
  1227.  
  1228.                    {file}    See the OVERVIEW section.
  1229.  
  1230.                    {variable} This is an environment variable that
  1231.                              contains the string that you want to
  1232.                              convert to upper case text. As with all
  1233.                              the BEBE string handling commands, you
  1234.                              can substitute a string enclosed in
  1235.                              quotes for an environment variable. The
  1236.                              converted text is stored in a variable
  1237.                              called %UPPER%.
  1238.  
  1239.                    EXAMPLE:  BEBE UPPER %GETSTRNG%
  1240.                    or
  1241.                              BEBE UPPER "This Should Be Upper Text"
  1242.  
  1243.                    This would create the environment variable
  1244.                    %UPPER% that contains the following string:
  1245.  
  1246.                              THIS SHOULD BE UPPER TEXT
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.